﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;

namespace Dev.Net.Server.Common.Authentication
{
    public class DevNetCredentialsValidator : UserNamePasswordValidator
    {
        public override void Validate(string userName, string password)
        {
            if (string.IsNullOrWhiteSpace(userName) || string.IsNullOrWhiteSpace(password))
            {
                throw new ArgumentNullException();
            }
            if (userName != "joe" || password != "bar")
                throw new SecurityTokenValidationException("The user could not be authenticated");
        }
    }
}
